Code coverage report for ./tests/some_suite.js

Statements: 86.96% (20 / 23)      Branches: 100% (0 / 0)      Functions: 81.82% (9 / 11)      Lines: 86.96% (20 / 23)     

All files » ./tests\ » some_suite.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51              1   1   1 2     1 1 1 1     1 1 1         1 1         1 1         1 1 1 1       1      
/**
 * Created with JetBrains PhpStorm.
 * User: Elena.Pogorelova
 * Date: 8/22/12
 * Time: 5:54 PM
 * To change this template use File | Settings | File Templates.
 */
describe('some suite', function () {
 
    var suiteWideFoo;
 
    beforeEach(function () {
        suiteWideFoo = 0;
    });
 
    describe('some nested suite', function () {
        var nestedSuiteBar;
        beforeEach(function () {
            nestedSuiteBar = 1;
        });
 
        it('nested expectation', function () {
            expect(suiteWideFoo).toEqual(0);
            expect(nestedSuiteBar).toEqual(2);
        });
 
    });
 
    it('top-level describe', function () {
        expect(suiteWideFoo).toEqual(0);
        /*expect(nestedSuiteBar).toEqual(undefined);*/
    });
});
 
describe("jasmine.any", function () {
    xit("matches any value", function () {  //'x' prefix == 'ignore'
        expect({}).toEqual(jasmine.any(Object));
        expect(12).toEqual(jasmine.any(Number));
    });
 
    describe("when used with a spy", function () {
        it("is useful for comparing arguments", function () {
            var foo = jasmine.createSpy('foo');
            foo(12, function () {
                return true
            });
 
            expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function));
        });
    });
});